/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package controllers;

import db.CustomerDB;
import db.CustomerInterface;
import java.util.ArrayList;
import models.Customer;

/**
 *
 * @author Steffen
 */
public class CustomerController {
    private boolean CustomerCreated;
    private boolean CustonerUpdated;
    private boolean CustomerRemoved;
    private Customer customer;
    private CustomerInterface cusdb = new CustomerDB();


    public CustomerController()
    {

    }

    //Create new Employee
    public Customer newCustomer (String name, String address, int zipcode, long phoneno)
    {
        CustomerCreated = false;
        Customer cus = new Customer(name, address, zipcode, phoneno);
        cusdb.addCustomer(cus);
        
        return cus;

    }

    public ArrayList<Customer> searchCustomers(int customerId, String customerName) {
        return this.cusdb.searchCustomers(customerId, customerName);
    }

    public void setCustomer(Customer customer)
        {
            this.customer = customer;
        }

    public Customer getCustomer()
        {
            return customer;
        }

    //public Customer updateCustomer()
    //  {
    //
    //  }
}
